C51 COMPILER V9.60.0.0   MAIN                                                              03/16/2023 09:24:19 PAGE 1   


C51 COMPILER V9.60.0.0, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN .\Release\main.obj
COMPILER INVOKED BY: C:\Keil_v5\C51\BIN\C51.EXE main.c OPTIMIZE(0,SPEED) REGFILE(.\Release\Sample_DrvGPIO.ORC) BROWSE IN
                    -CDIR(..\..\..\..\C51SIS\C51;..\..\..\Include\Driver) DEBUG OBJECTEXTEND CODE TABS(2) OBJECT(.\Release\main.obj)

line level    source

   1          /**************************************************************************//**
   2           * @file           main.c
   3           * @version        V1.0
   4           * $Revision:      1 $
   5           * $Date:          2017/01/04 $
   6           * @brief          Main function
   7           * @Author         Jeffrey Kang
   8           * @ContactInfo    chkang@esmt.com.tw
   9           *
  10           * @note
  11           *
  12           * Copyright (C) 1998 Elite Semiconductor Memory Technology Corp.
  13           * All rights reserved.
  14           *
  15           ******************************************************************************/
  16          
  17          
  18          #include <REG52.h>
  19          #include "system_FE81001.h"
  20          
  21          
  22          /**
  23           * @brief       delay function
  24           *
  25           * @param       None
  26           *
  27           * @return      None
  28           *
  29           * @details     1. 
  30           */
  31          void delay (int cnt )
  32          {
  33   1        unsigned int i , j ;
  34   1        
  35   1        for(j=0 ; j<cnt ; j++)
  36   1        for( i = 0 ; i < 200 ; i++ ); 
  37   1        
  38   1      }
  39          
  40          
  41          /**
  42           * @brief       ClkInit function
  43           *
  44           * @param       None
  45           *
  46           * @return      None
  47           *
  48           * @details     1. 
  49           */
  50          void Clock_Config(void)
  51          {
  52   1        PORT_PAPBPCPD_Clock_Enable();
  53   1      }
  54          
C51 COMPILER V9.60.0.0   MAIN                                                              03/16/2023 09:24:19 PAGE 2   

  55          
  56          void IOConfig()
  57          {
  58   1        /* Set PC7 input as button */
  59   1        PORT_SetPCInput(BIT7);
  60   1      
  61   1        /* Set PD1. ,PD2.,PD3 output */
  62   1        PORT_SetPDPushPull(BIT1 | BIT2 | BIT3 );
  63   1      }
  64          
  65          
  66          /**
  67           * @brief       main function
  68           *
  69           * @param       None
  70           *
  71           * @return      None
  72           *
  73           * @details     1. 
  74           */
  75          int main( void )
  76          {
  77   1        Clock_Config();
  78   1        IOConfig();
  79   1        
  80   1        PD1 = 0; // LED_G1 On
  81   1        PD2 = 1 ; //LED_R Off
  82   1        PD3= 0;  // LED_G2  On
  83   1      
  84   1        
  85   1        while(1)
  86   1        {
  87   2            if( Get_PCx_input(7) == 0)   // PC7  = 0 , button down
  88   2            {
  89   3                PD2 = 0 ; //LED_R On
  90   3            }
  91   2            else
  92   2            {
  93   3                PD2 = 1 ; //LED_R Off
  94   3            }
  95   2        }
  96   1      }
  97          
C51 COMPILER V9.60.0.0   MAIN                                                              03/16/2023 09:24:19 PAGE 3   

ASSEMBLY LISTING OF GENERATED OBJECT CODE


             ; FUNCTION _delay (BEGIN)
                                           ; SOURCE LINE # 31
0000 8E00        R     MOV     cnt,R6
0002 8F00        R     MOV     cnt+01H,R7
                                           ; SOURCE LINE # 32
                                           ; SOURCE LINE # 35
0004 750000      R     MOV     j,#00H
0007 750000      R     MOV     j+01H,#00H
000A         ?C0001:
000A C3                CLR     C
000B E500        R     MOV     A,j+01H
000D 9500        R     SUBB    A,cnt+01H
000F E500        R     MOV     A,j
0011 9500        R     SUBB    A,cnt
0013 5025              JNC     ?C0007
                                           ; SOURCE LINE # 36
0015 750000      R     MOV     i,#00H
0018 750000      R     MOV     i+01H,#00H
001B         ?C0004:
001B C3                CLR     C
001C E500        R     MOV     A,i+01H
001E 94C8              SUBB    A,#0C8H
0020 E500        R     MOV     A,i
0022 9400              SUBB    A,#00H
0024 500A              JNC     ?C0003
0026 0500        R     INC     i+01H
0028 E500        R     MOV     A,i+01H
002A 7002              JNZ     ?C0015
002C 0500        R     INC     i
002E         ?C0015:
002E 80EB              SJMP    ?C0004
0030         ?C0003:
0030 0500        R     INC     j+01H
0032 E500        R     MOV     A,j+01H
0034 7002              JNZ     ?C0016
0036 0500        R     INC     j
0038         ?C0016:
0038 80D0              SJMP    ?C0001
                                           ; SOURCE LINE # 38
003A         ?C0007:
003A 22                RET     
             ; FUNCTION _delay (END)

             ; FUNCTION Clock_Config (BEGIN)
                                           ; SOURCE LINE # 50
                                           ; SOURCE LINE # 51
                                           ; SOURCE LINE # 52
0000 90E205            MOV     DPTR,#0E205H
0003 E0                MOVX    A,@DPTR
0004 FF                MOV     R7,A
0005 EF                MOV     A,R7
0006 44F0              ORL     A,#0F0H
0008 FF                MOV     R7,A
0009 EF                MOV     A,R7
000A F0                MOVX    @DPTR,A
                                           ; SOURCE LINE # 53
000B 22                RET     
             ; FUNCTION Clock_Config (END)

C51 COMPILER V9.60.0.0   MAIN                                                              03/16/2023 09:24:19 PAGE 4   

             ; FUNCTION IOConfig (BEGIN)
                                           ; SOURCE LINE # 56
                                           ; SOURCE LINE # 57
                                           ; SOURCE LINE # 59
0000 90E032            MOV     DPTR,#0E032H
0003 E0                MOVX    A,@DPTR
0004 FF                MOV     R7,A
0005 EF                MOV     A,R7
0006 547F              ANL     A,#07FH
0008 FF                MOV     R7,A
0009 EF                MOV     A,R7
000A F0                MOVX    @DPTR,A
000B 90E031            MOV     DPTR,#0E031H
000E E0                MOVX    A,@DPTR
000F FF                MOV     R7,A
0010 EF                MOV     A,R7
0011 547F              ANL     A,#07FH
0013 FF                MOV     R7,A
0014 EF                MOV     A,R7
0015 F0                MOVX    @DPTR,A
0016 90E030            MOV     DPTR,#0E030H
0019 E0                MOVX    A,@DPTR
001A FF                MOV     R7,A
001B EF                MOV     A,R7
001C 547F              ANL     A,#07FH
001E FF                MOV     R7,A
001F EF                MOV     A,R7
0020 F0                MOVX    @DPTR,A
                                           ; SOURCE LINE # 62
0021 90E044            MOV     DPTR,#0E044H
0024 E0                MOVX    A,@DPTR
0025 FF                MOV     R7,A
0026 EF                MOV     A,R7
0027 54F1              ANL     A,#0F1H
0029 FF                MOV     R7,A
002A EF                MOV     A,R7
002B F0                MOVX    @DPTR,A
002C 90E043            MOV     DPTR,#0E043H
002F E0                MOVX    A,@DPTR
0030 FF                MOV     R7,A
0031 EF                MOV     A,R7
0032 54F1              ANL     A,#0F1H
0034 FF                MOV     R7,A
0035 EF                MOV     A,R7
0036 F0                MOVX    @DPTR,A
0037 90E042            MOV     DPTR,#0E042H
003A E0                MOVX    A,@DPTR
003B FF                MOV     R7,A
003C EF                MOV     A,R7
003D 440E              ORL     A,#0EH
003F FF                MOV     R7,A
0040 EF                MOV     A,R7
0041 F0                MOVX    @DPTR,A
                                           ; SOURCE LINE # 63
0042 22                RET     
             ; FUNCTION IOConfig (END)

             ; FUNCTION main (BEGIN)
                                           ; SOURCE LINE # 75
                                           ; SOURCE LINE # 76
                                           ; SOURCE LINE # 77
0000 120000      R     LCALL   Clock_Config
C51 COMPILER V9.60.0.0   MAIN                                                              03/16/2023 09:24:19 PAGE 5   

                                           ; SOURCE LINE # 78
0003 120000      R     LCALL   IOConfig
                                           ; SOURCE LINE # 80
0006 90E046            MOV     DPTR,#0E046H
0009 E4                CLR     A
000A F0                MOVX    @DPTR,A
                                           ; SOURCE LINE # 81
000B 90E047            MOV     DPTR,#0E047H
000E 7401              MOV     A,#01H
0010 F0                MOVX    @DPTR,A
                                           ; SOURCE LINE # 82
0011 90E048            MOV     DPTR,#0E048H
0014 E4                CLR     A
0015 F0                MOVX    @DPTR,A
0016         ?C0010:
                                           ; SOURCE LINE # 85
                                           ; SOURCE LINE # 86
                                           ; SOURCE LINE # 87
0016 90E03D            MOV     DPTR,#0E03DH
0019 E0                MOVX    A,@DPTR
001A FF                MOV     R7,A
001B EF                MOV     A,R7
001C 5480              ANL     A,#080H
001E FF                MOV     R7,A
001F EF                MOV     A,R7
0020 C4                SWAP    A
0021 13                RRC     A
0022 13                RRC     A
0023 13                RRC     A
0024 5401              ANL     A,#01H
0026 FF                MOV     R7,A
0027 7E00              MOV     R6,#00H
0029 EF                MOV     A,R7
002A 4E                ORL     A,R6
002B 7007              JNZ     ?C0012
                                           ; SOURCE LINE # 88
                                           ; SOURCE LINE # 89
002D 90E047            MOV     DPTR,#0E047H
0030 E4                CLR     A
0031 F0                MOVX    @DPTR,A
                                           ; SOURCE LINE # 90
0032 80E2              SJMP    ?C0010
0034         ?C0012:
                                           ; SOURCE LINE # 92
                                           ; SOURCE LINE # 93
0034 90E047            MOV     DPTR,#0E047H
0037 7401              MOV     A,#01H
0039 F0                MOVX    @DPTR,A
                                           ; SOURCE LINE # 94
                                           ; SOURCE LINE # 95
003A 80DA              SJMP    ?C0010
003C 22                RET     
             ; FUNCTION main (END)



MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    199    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =      6    ----
C51 COMPILER V9.60.0.0   MAIN                                                              03/16/2023 09:24:19 PAGE 6   

   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)
